]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionsService: Fix setting prefs dialog parent
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 16 Jan 2021 00:43:53 +0000 (01:43 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 18 Jan 2021 11:40:46 +0000 (11:40 +0000)
Between the GTK4 port and the latest GTK4 version, calling realize()
on a newly created window to force its surface to be created stopped
working.

So instead, wait for the window to get realized regularly to set its
parent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1574>

js/dbusServices/extensions/extensionsService.js

index 8217675b0ca314817a6632f3e5b80d5280667716..35e780578595a0bd1715ac98fe53eee04a231bf9 100644 (file)
@@ -120,15 +120,15 @@ var ExtensionsService = class extends ServiceImplementation {
             const extension = ExtensionUtils.deserializeExtension(serialized);
 
             const window = new ExtensionPrefsDialog(extension);
-            window.realize();
+            window.connect('realize', () => {
+                let externalWindow = null;
 
-            let externalWindow = null;
+                if (parentWindow)
+                    externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow);
 
-            if (parentWindow)
-                externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow);
-
-            if (externalWindow)
-                externalWindow.set_parent_of(window.get_surface());
+                if (externalWindow)
+                    externalWindow.set_parent_of(window.get_surface());
+            });
 
             if (options.modal)
                 window.modal = options.modal.get_boolean();